package com.nbsaas.boot.shopArticle.rest.resource;

import com.nbsaas.boot.shopArticle.api.apis.ShopArticleDocumentApi;
import com.nbsaas.boot.shopArticle.data.entity.ShopArticleDocument;
import com.nbsaas.boot.shopArticle.api.domain.request.ShopArticleDocumentRequest;
import com.nbsaas.boot.shopArticle.api.domain.response.ShopArticleDocumentResponse;
import com.nbsaas.boot.shopArticle.api.domain.simple.ShopArticleDocumentSimple;
import com.nbsaas.boot.shopArticle.rest.convert.ShopArticleDocumentSimpleConvert;
import com.nbsaas.boot.shopArticle.rest.convert.ShopArticleDocumentEntityConvert;
import com.nbsaas.boot.shopArticle.rest.convert.ShopArticleDocumentResponseConvert;
import com.nbsaas.boot.shopArticle.data.repository.ShopArticleDocumentRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class ShopArticleDocumentResource extends BaseResource<ShopArticleDocument,ShopArticleDocumentResponse, ShopArticleDocumentSimple, ShopArticleDocumentRequest>  implements ShopArticleDocumentApi {

    @Resource
    private ShopArticleDocumentRepository shopArticleDocumentRepository;

    @Override
    public JpaRepositoryImplementation<ShopArticleDocument, Serializable> getJpaRepository() {
        return shopArticleDocumentRepository;
    }

    @Override
    public Function<ShopArticleDocument, ShopArticleDocumentSimple> getConvertSimple() {
        return new ShopArticleDocumentSimpleConvert();
    }

    @Override
    public Function<ShopArticleDocumentRequest, ShopArticleDocument> getConvertForm() {
        return new ShopArticleDocumentEntityConvert();
    }

    @Override
    public Function<ShopArticleDocument, ShopArticleDocumentResponse> getConvertResponse() {
        return new ShopArticleDocumentResponseConvert();
    }




}


